// std::multimap stls使用例子
#include <stdio.h>
#include <stdlib.h>

#include <iostream>
#include <map>
using namespace std;
int main() {
  std::multimap<int, std::string> mmap;
  mmap.insert(pair<int, std::string>(1, "fff"));
  mmap.insert(pair<int, std::string>(1, "fff"));
  mmap.insert(pair<int, std::string>(2, "ee"));
  mmap.insert(pair<int, std::string>(2, "ff"));
  for (auto it = mmap.begin(); it != mmap.end(); it++) {
    printf("%d,%s\n", it->first, it->second.c_str());
  }
  std::multimap<int, std::string>::iterator begin, end, it;
  begin = mmap.lower_bound(1);
  end = mmap.upper_bound(1);
  for (it = begin; it != end; it++) {
    printf("%d,%s\n", it->first, it->second.c_str());
  }
  return 0;
}